package com.piaoniu.open.api.domain.order.request;

import com.piaoniu.open.api.domain.BaseRequest;
import com.piaoniu.open.api.domain.order.response.CreateOrderResponse;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;

/**
 * <a href="https://open.piaoniu.com/orderCreate.html">创建订单</a>
 */
@Data
@ToString
public class CreateOrderRequest implements BaseRequest<CreateOrderResponse> {

    private String orderId;

    private int ticketGroupId;

    /**
     * 暂时只有京东用拿来查ticketGroup
     */
    private int ticketCategoryId;
    /**
     * 总金额 包含拆单费和邮费
     */
    private BigDecimal amount;

    private int count;

    private int deliverType;

    private String receiverName;

    private String phone;

    private String address;

    private String district;

    /**
     * 证件信息json数组字符串
     * @see com.piaoniu.open.api.domain.order.dto.IdCardDTO
     */
    private String idCards;
    /**
     *  邮费
     */
    private BigDecimal postage;
    /**
     * 拆单费
     */
    private BigDecimal splitOrderFee;

    @Override
    public Class getResponseType() {
        return CreateOrderResponse.class;
    }

    @Override
    public String getUrl() {
        return "/openapi/v2/order/makeOrder/";
    }

    @Override
    public METHOD getMethod() {
        return METHOD.POST;
    }
}
